powered by
closest(x, y, tol = +Inf)
x
closest
y
TRUE
tol
FALSE
match
ref <- seq(1:5) closest(2.8, ref) closest(2.5, ref, .1) # no match because of lower tolerance
Run the code above in your browser using DataLab